package com.cuitrip.business.notice.ui;

import com.cuitrip.business.notice.model.MessageServerItem;
import com.lab.utils.Utils;

/**
 * Created by baziii on 15/8/10.
 */
public class MessageMode implements java.io.Serializable {
    protected String name;
    protected String id;
    protected String date;
    protected String content;
    protected String gmtCreated;
    protected boolean isRead;
    protected int type;//1系统消息，其他为预约消息

    public static final int SYSTEM_TYPE = 1;
    public static final int ORDER_TYPE = 2;


    //是否正在左滑
    protected boolean isLeft = false;

    public MessageMode(String name, String id, String date, String data, boolean isRead, int type , String gmtCreated) {
        this.name = name;
        this.id = id;
        this.date = date;
        this.content = data;
        this.isRead = isRead;
        this.type = type;
        this.gmtCreated=gmtCreated;
    }

    public String getName() {
        return name;
    }

    public String getId() {
        return id;
    }

    public String getDate() {
        return date;
    }

    public String getContent() {
        return content;
    }

    public boolean isLeft() {
        return isLeft;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public void setIsLeft(boolean isLeft) {
        this.isLeft = isLeft;
    }

    public boolean isRead() {
        return isRead;
    }

    public void setIsRead(boolean isRead) {
        this.isRead = isRead;
    }

    public String getGmtCreated() {
        return gmtCreated;
    }

    public void setGmtCreated(String gmtCreated) {
        this.gmtCreated = gmtCreated;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public static MessageMode getInstance(MessageServerItem item) {
        return new MessageMode(item.getTitle(), item.getMessageId(),
                Utils.getMsToSeconds(item.getGmtCreated()), item.getContent(), item.getIsRead()==1
              ,item.getType(),item.getGmtCreated());
    }
}
